﻿
namespace VMWareLabWorkflowsDataContracts
{
    using System;
    using System.ComponentModel;
    using Microsoft.TeamFoundation.Build.Client;

    /// <summary>
    /// Data for the wizard
    /// </summary>
    public class VMWareWizardData : INotifyPropertyChanged
    {
        private static readonly VMWareWizardData _instance = new VMWareWizardData();
        private string currentControlName;
        
        /// <summary>
        /// Gets the VM ware wizzard data instance.
        /// </summary>
        /// <value>The VM ware wizzard data instance.</value>
        public static VMWareWizardData VMWareWizzardDataInstance
        {
            get
            {
                return _instance;
            }
        }

        /// <summary>
        /// Gets or sets the VM ware lab workflow details.
        /// </summary>
        /// <value>The VM ware lab workflow details.</value>
        public VMWareLabWorkflowDetails VMWareLabWorkflowDetails { get; set; }

        /// <summary>
        /// Gets or sets the build definition.
        /// </summary>
        /// <value>The build definition.</value>
        public IBuildDefinition BuildDefinition { get; set; }

        /// <summary>
        /// Gets or sets the service provider.
        /// </summary>
        /// <value>The service provider.</value>
        public IServiceProvider ServiceProvider { get; set; }

        /// <summary>
        /// Gets or sets the name of the current control.
        /// </summary>
        /// <value>The name of the current control.</value>
        public string CurrentControlName
        {
            get
            {
                return this.currentControlName;
            }
            set
            {
                this.currentControlName = value;
                this.OnPropertyChanged("CurrentControlName");
            }
        }

        protected VMWareWizardData()
        {
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
    }
}
